package fms.acarsMsgProcessUtil;

/**
 * Created with IntelliJ IDEA.
 * Time: 16:38
 * 流水号(MSN)
 */
public class MessageStreamNumber {
    /// <summary>
    /// 设备代码
    /// </summary>
    public String DeviceCode;

    /// <summary>
    /// 流水号
    /// </summary>
    public int StreamNumber;

    /// <summary>
    /// 块编号
    /// </summary>
    public String BlockNumber;

    public MessageStreamNumber() {
        this.DeviceCode = "";
        this.StreamNumber = 0;
        this.BlockNumber = "";
    }

    public String toString() {
        // %2$02d：第二个参数是2为整数，不足用0在左侧填充
        String msn = String.format("%1$s%2$02d%3$s", DeviceCode, StreamNumber, BlockNumber);
        return msn.equals("00") ? "" : msn;
    }
}
